package com.training.iyogo.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.training.iyogo.dao.ICourseDAO;
import com.training.iyogo.domain.Course;
@Repository
@Transactional
public class CourseDAOImpl extends BaseDAOImpl<Course> implements ICourseDAO {

	@Override
	public Course findByName(String name) {
		List<Course> list = find("from Course c" + " where c.courseName =?0", name);
		if (list.size() > 0)
			return list.get(0);
		return null;
	}
	
}
